
Last chance! 50% off unlimited learning
Sale ends in
Regularised discriminant analysis for compositional data using the
alfa.rda(xnew, x, ina, a, gam = 1, del = 0)
A matrix with the new compositional data whose group is to be predicted. Zeros are allowed, but you must be carefull to choose strictly positive vcalues of
A matrix with the available compositional data. Zeros are allowed, but you must be carefull to choose strictly positive vcalues of
A group indicator variable for the avaiable data.
The value of
This is a number between 0 and 1. It is the weight of the pooled covariance and the diagonal matrix.
This is a number between 0 and 1. It is the weight of the LDA and QDA.
A list including:
The estimated probabilities of the new data of belonging to each group.
The estimated socres of the new data of each group.
The estimated group membership of the new data.
The covariance matrix of each group is calcualted and then the pooled covariance matrix. The spherical covariance matrix consists of the average of the pooled variances in its diagonal and zeros in the off-diagonal elements. gam is the weight of the pooled covariance matrix and 1-gam is the weight of the spherical covariance matrix, Sa = gam * Sp + (1-gam) * sp. Then it is a compromise between LDA and QDA. del is the weight of Sa and 1-del the weight of each group covariance group. This function is a wrapper for alfa.rda.
Friedman Jerome, Trevor Hastie and Robert Tibshirani (2009). The elements of statistical learning, 2nd edition. Springer, Berlin
Tsagris Michail, Simon Preston and Andrew T.A. Wood (2016). Improved classification for compositional data using the
# NOT RUN {
x <- as.matrix(iris[, 1:4])
x <- x / rowSums(x)
ina <- iris[, 5]
mod <- alfa.rda(x, x, ina, 0)
table(ina, mod$est)
mod2 <- alfa.rda(x, x, ina, 0.5)
table(ina, mod2$est)
# }
Run the code above in your browser using DataLab